import React, { Component } from 'react'

export default class HomeItem extends Component {

    shouldComponentUpdate(nextValue) {
        return nextValue.id !== this.props.id
    }

    render() {
        console.log('======================')
        console.log(this.props)
        let it = this.props
        return (
            <li>
                <img onClick={this.props.toDetail.bind(this, it.id)} src={it.image} alt=""/>
                {
                    it.title
                    ?
                    <span>{it.title}</span>
                    :
                    null
                }
            </li>
        )
    }
}
